package cn.itcast.day02.demo;

public class text03 {

    public static void main(String[] args) {

        int[] array = {10,20,30,40,50};
        for (int i = 0; i < array.length; i++) {
            System.out.println(array[i]);
        }
        System.out.println("==========");

        for (int min = 0,max = array.length - 1; min < max ;min++,max--) {
            int temp = array[min];
            array[min] = array[max];
            array[max] = temp;
        }
        for (int i = 0; i < array.length; i++) {
            System.out.println(array[i]);
        }
        /*int max = array[0];
        int min = array[0];*/
       /* for (int i = 1; i < array.length; i++){
            if (array[i] > max) {
                max = array[i];

            }
        }

        for (int i = 1;i < array.length; i++) {
            if (array[i] < min) {
                min = array[i];
            }
        }*/
        /*System.out.println(max);
        System.out.println(min);*/
        /*for (int i = 0; i < array.length ; i++) {
            System.out.println(array[i]);
        }
        System.out.println("========");
        int t = 0;
        //数组元素的反转
        for (int i = 0; i < array.length/2; i++) {
            t = array[i];
            array[i] = array[4-i];
            array[4-i] = t;
        }

        for (int i = 0; i < array.length ; i++) {
            System.out.println(array[i]);
        }*/
    }
}
